Overview
These are the database tables and related LINQ to SQL classes used in the prototype DataViewer program.
Months
Table containing month information
Column | Type | Key | Allow Nulls | Description |
MonthId | int | Primary | No | Unique ID |
Date | datetime | No | No | Date of the start of the month |
StartSavings | float | No | No | Starting chequing account value |
StartChequing | float | No | No | Starting savings account value |
StartCash | float | No | No | Starting cash value |
Month.cs
Transactions
Table containing transaction information
Column | Type | Key | Allow Nulls | Description |
TransactionId | int | Primary | No | Unique ID |
MonthId | int | Foreign | No | ID of the containing month |
Date | datetime | No | No | Date the transaction occurred |
Description | nvarchar(150) | No | No | Description of the transaction |
Amount | float | No | No | Amount of the transaction |
CategoryId | int | Foreign | No | ID of the related category |
IsCash | bit | No | No | True if transaction was with cash |
RecurringExpenseMonthId | int | Foreign | Yes | Starting savings account value |
SpecialAccountMonthId | int | Foreign | Yes | ID of the relates special account (if any) |
Transaction.cs
Categories
Table containing transaction category information
Column | Type | Key | Allow Nulls | Description |
CategoryId | int | Primary | No | Unique ID |
Name | nvarchar(150) | No | No | Name of the category |
Colour | nvarchar(7) | No | No | Background colour displayed |
Account | int | No | No | The account the category uses |
Type | int | No | No | The type the category uses |
InUse | bit | No | No | True if still being used |
IsSystem | bit | No | No | True if system reserved |
Category.cs
BudgetTypes
Table containing global budget type information
Column | Type | Key | Allow Nulls | Description |
BudgetTypeId | int | Primary | No | Unique ID |
Name | nvarchar(150) | No | No | Name of the budget type |
StandardAmount | float | No | No | Standard amount per month |
InUse | bit | No | No | True if still being used |
BudgetType.cs
BudgetCategories
Table mapping budget types to categories
Column | Type | Key | Allow Nulls | Description |
BudgetCategoryId | int | Primary | No | Unique ID |
BudgetTypeId | int | Foreign | No | ID of the Budget Type |
CategoryId | int | Foreign | No | ID of the Category |
BudgetCatagory.cs
BudgetMonths
Table containing monthly instances of budget types
Column | Type | Key | Allow Nulls | Description |
BudgetMonthId | int | Primary | No | Unique ID |
BudgetTypeId | int | Foreign | No | The key of the related type |
MonthId | int | Foreign | No | The key of the related month |
Amount | float | No | No | The amount per month |
BudgetMonth.cs
SpecialAccounts
Table containing global special account information
Column | Type | Key | Allow Nulls | Description |
SpecialAccountId | int | Primary | No | Unique ID |
Type | int | No | No | The type of the special account |
Name | nvarchar(150) | No | No | The name of the special account |
SpecialAccount.cs
SpecialAccountMonths
Table containing monthly instances of special accounts
Column | Type | Key | Allow Nulls | Description |
SpecialAccountMonthId | int | Primary | No | Unique ID |
SpecialAccountId | int | Foreign | No | The key of the related special account |
MonthId | int | Foreign | No | The key of the related month |
Amount | float | No | No | The starting amount |
SpecialAccountMonth.cs
RecurringExpenses
Table containing global recurring expense information
Column | Type | Key | Allow Nulls | Description |
RecurringExpenseId | int | Primary | No | Unique ID |
Name | nvarchar(150) | No | No | The name of the recurring expense |
InUse | bit | No | No | True if still being used |
RecurringExpense.cs
RecurringExpenseItems
Table containing information about specific items belong to recurring expenses
Column | Type | Key | Allow Nulls | Description |
RecurringExpenseItemId | int | Primary | No | Unique ID |
RecurringExpenseId | int | Foreign | No | The key of the related recurring expense |
ParentId | int | Foreign | Yes | The key of the parent item (null if root) |
Name | nvarchar(150) | No | No | The item name |
Type | int | No | No | The item type |
Amount | float | No | No | The item amount |
RecurringExpenseItem.cs
RecurringExpenseMonths
Table containing monthly instances of recurring expenses
Column | Type | Key | Allow Nulls | Description |
RecurringExpenseMonthId | int | Primary | No | Unique ID |
RecurringExpenseId | int | Foreign | No | The key of the related recurring expense |
MonthId | int | Foreign | No | The key of the related month |
ExpectedAmount | float | No | No | The month's expected amount |
RecurringExpenseMonth.cs